<?
//REQUIRE("admin/admin_function.php");
$titre="Visionner le times";
titre($titre);


//--------------------------------------------



 $tmppath="../../";


echo"<table width=\"50%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <tr>
    <td><div align=\"center\">Tous</div></td>
    <td><div align=\"center\">Article</div></td>
    <td><div align=\"center\">Annonce</div></td>
    <td><div align=\"center\">Lettre</div></td>
    <td><div align=\"center\">Sauvegarder</div></td>
  </tr>
</table><BR>";




SWITCH ($order){


 DEFAULT:
    $order_by="WHERE times_save=0";
 BREAK;
}

//Le style
$style[1]="Article";
$style[2]="Annonce";
$style[3]="Lettre";





$query="SELECT times_id,times_sujet,times_texte,times_date,times_creator,times_type FROM sdtimes_article $order_by ";
//0 = id 1 = sujet 2 origine 3 =date 4=lu
$resultat=mysql_query($query);


echo"<form name=\"form1\" method=\"post\" action=\"messagerie_test.php\">";
echo"
<center><input name=\"option\" type=\"radio\" value=\"0\" checked>
Effacer
<input name=\"option\" type=\"radio\" value=\"1\">
Archiver</center>" ;

ECHO "<BR><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" >";
ECHO"<table width=\"95%\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
  <tr>
    <td><table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td width=\"5\" background=\"templates/default/FondS.jpg\"><div align=\"center\"><strong></strong></div></td>

          <td width=\"25%\" background=\"templates/default/FondS.jpg\"><div align=\"left\"><strong>Sujet</strong></div></td>
          <td width=\"15\" background=\"templates/default/FondS.jpg\"><div align=\"center\"><strong>Provenance</strong></div></td>
          <td width=\"20\" background=\"templates/default/FondS.jpg\"><div align=\"center\"><strong>Date</strong></div></td>
          <td width=\"25%\" background=\"templates/default/FondS.jpg\"><div align=\"center\"><strong>Style</strong></div></td>
        </tr>";
        
        
$var_tmp=0;
$nbr_cat=0;
$i=0;
WHILE ($tmp=mysql_fetch_array($resultat)){

$nbr_cat++;
IF ($var_tmp==0){
$bgr="background=\"$templates/Fond.jpg\"";
$var_tmp=1;

}
ELSE{
$bgr="";
$var_tmp=0;

}
$query="SELECT perso_name FROM sduser_perso WHERE perso_id=$tmp[4]";
$resultat2=mysql_query($query);
$tmp2=mysql_fetch_array($resultat2);


$i++;


//L'importance du message
//-----------------------

//DATE
//--------


$tmp_var= $tmp[5];

ECHO"<tr>
          <td $bgr width=\"5%\"><input type=\"checkbox\" name=\"v[$i]\" value=\"$tmp[0]\"></td>

          <td $bgr><div align=\"left\"><a href=\"accueil.php?p=sdtimes_voirmessage&article=$tmp[0]&$SID \" target=\"_self\"><font size=\"2\">$tmp[1]</font></div></a></div></td>
          <td $bgr><div align=\"center\">$tmp2[0]</div></td>
          <td $bgr><div align=\"center\"><font size=\"1\">$tmp[3]</font></div></td>
          <td $bgr><div align=\"center\">$style[$tmp_var]</div></td>

          </tr>";




}//Fin while.
        
        
        
        echo "</table></table><br>";

echo"<input id=\"mode\" type=\"hidden\" name=\"mode\" value=\"test_sdtimes\">
<div align=\"center\"><input type=\"submit\" name=\"Submit\" value=\"envoyer\"></div>
</form>";

?>
